tools/xl: Allow callers of `xl info` to select specific information
When scripting, it is much more convenient to use:
[root@fusebot ~]# xl info xen_version
4.8-unstable
than to construct some sed/awk/other to parse:
[root@fusebot ~]# xl info
...
xen_version : 4.8-unstable
...
This works by wrapping all printf() calls in main_info() with maybe_printf(),
which formats its arguments, compares the resulting string to the provided
restriction, and discards it if no match is found.
A restriction like this doesn't make sense in combination with --numa, so is
excluded in that case.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>